﻿Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration.ConfigurationManager

Partial Class LibroSugerencias
    Inherits System.Web.UI.Page

    Dim cn As New SqlConnection(ConnectionStrings("cn").ConnectionString)

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Master.MostrarClienteSession()
    End Sub

    Protected Sub btnEnviarMail_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnEnviarMail.Click
        Try
            If txtCorreo.Text = "" Then
                MsgBox("Error! No hay usuario")
            Else
                Dim da As New SqlDataAdapter(
                "usp_RegistrarSugerencia", cn)
                da.SelectCommand.CommandType = CommandType.StoredProcedure;

                da.SelectCommand.Parameters.
                    Add("@id", SqlDbType.VarChar).Value = txtCorreo.Text

                Dim tb As New DataTable
                da.Fill(tb)
            End If
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
        txtCorreo.Text = ""
        rtxtMensaje.Text = ""
    End Sub

End Class
